package com.yihu.cms.util;

public class SerialGenerator {

	private final AtomicRangeInteger atomicRangeInteger = new AtomicRangeInteger(0, 40);

	public long getSerialId()
	{
		final long currentTimeMillis = System.currentTimeMillis();
		return (long) (currentTimeMillis << 32 | atomicRangeInteger.incrAndGet());
	}
	public static void main(String args[]){
		SerialGenerator s = new SerialGenerator();
		for(int i=0;i<30;i++){	
			System.out.println(s.getSerialId());
		}
	}
}
